package com.joyoung.common.utils.singn;

import java.io.UnsupportedEncodingException;

public class RequesUtil {
    public RequesUtil() {
    
    }
    
    public static String getSign(String str, byte[] data, String salt) {
        byte[] strByte;
        byte[] saltByte;
        try {
            saltByte = salt.getBytes("utf-8");
            strByte = str.getBytes("utf-8");
        } catch (UnsupportedEncodingException var9) {
            return null;
        }
    
        int strlength = strByte.length;
        int datalength = 0;
        if (data != null) {
            datalength = data.length;
        }
    
        int saltlength = saltByte.length;
        byte[] value = new byte[strlength + datalength + saltlength];
        System.arraycopy(strByte, 0, value, 0, strlength);
        if (datalength > 0) {
            System.arraycopy(data, 0, value, strlength, datalength);
        }
    
        System.arraycopy(saltByte, 0, value, strlength + datalength, saltlength);
        return Encrypt.MD5(value);
    }
    
}

